home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 07511000 / var0888.dms / var0888.adf / WoManD / man / Exec / Lists < prev    next >
Text File  |  1992-09-19  |  4KB  |  101 lines

  1. LISTS(1)                  AMIGA DOS EXEC FUNCTIONS                  LISTS(1)
  2.  
  3. NAME
  4.      Insert(), AddHead(), AddTail(), Remove(), RemHead(), RemTail(), 
  5.      Enqueue(), FindName().
  6.  
  7. SYNOPSIS
  8.      void Insert(struct List *list, struct Node *node , struct Node *pred)
  9.                 (A0/A1/A2)
  10.      void AddHead(struct List *list, struct Node *node) (A0/A1) 
  11.      void AddTail(struct List *list, struct Node *node) (A0/A1)
  12.      void Remove(struct Node *node) (A1)
  13.      struct Node *RemHead(struct List *list) (A0)
  14.      struct Node *RemTail(struct List *list) (A0) 
  15.      void Enqueue(struct List *list, struct Node *node) (A0/A1)  
  16.      struct Node *FindName(struct List *list, char *name) (A0/A1)  
  17.  
  18. LIBRARY
  19.      Exec
  20.  
  21. OFFSET
  22.      Insert   0xea
  23.      AddHead  0xf0
  24.      AddTail  0xf6
  25.      Remove   0xfc
  26.      RemHead  0x102
  27.      RemTail  0x108
  28.      Enqueue  0x10e
  29.      FindName 0x114
  30.  
  31. DESCRIPTION
  32.      The functions use the following structures to create linked list of
  33.      nodes:
  34.  
  35.      struct Node 
  36.      { struct Node *ln_Succ;
  37.        struct Node *ln_Pred;
  38.        UBYTE ln_Type;
  39.        BYTE ln_Pri;
  40.        char *ln_Name;
  41.      }
  42.  
  43.      struct List 
  44.      { struct Node *lh_Head;
  45.        struct Node *lh_Tail;
  46.        struct Node *lh_TailPred;
  47.        UBYTE lh_Type;
  48.        UBYTE lh_pad;
  49.      }
  50.  
  51.      Before being used, a list must be initialized as follow:
  52.  
  53.            lh_Head must point to lh_Tail.
  54.            lh_TailPred must point to lh_HeadTail.
  55.            lh_Tail must be zero.
  56.            lh_Type must be set to the same data type as that of the nodes 
  57.                    to be kept in this list.
  58.  
  59. FUNCTIONS 
  60.      - Insert : inserts the node pointed to by "node" after the node 
  61.              pointed to by "pred" in the list pointed to by "list".
  62.              If pred is NULL or equal to list, then the node is inserted at
  63.              the beginning of the list.
  64.              list : pointer to the list header.
  65.              node : pointer to the node to insert.
  66.              pred : pointer to the node to insert after.
  67.    
  68.      - AddHead : inserts the node pointed to by node at the start of the list
  69.              pointed to by list.
  70.              list : pointer to the list header.
  71.              node : pointer to the node to insert.
  72.  
  73.      - AddTail : links the node pointed to by node at the end of the list
  74.              pointed to by list. The node becomes the last element of the 
  75.              list.
  76.              list : pointer to the list header.
  77.              node : pointer to the node to insert.
  78.  
  79.      - Remove : removes the specified node from its list.
  80.              node : the node to remove from the list.
  81.  
  82.      - RemHead : removes the first node of the specified list.
  83.              list : the list to truncate.
  84.              return : a pointer to the removed node or NULL if the list
  85.                    was empty.
  86.  
  87.      - RemTail : removes the last node of the specified list.
  88.              list : the list to truncate. 
  89.              return : a pointer to the removed node or NULL if the list
  90.                    was empty.
  91.  
  92.      - Enqueue : adds a node in the list, keeping the nodes ordered by their
  93.              priority (higher priority are at the head of the list.)
  94.              list : pointer to the list header.
  95.              node : pointer to the node to insert. 
  96.  
  97.      - FindName : searches a node in the list with the specified name.
  98.              list : pointer to the list header to search in.
  99.              name : the name for the node.
  100.              return : a pointer to the node found, or zero if none is found.
  101.